#include <iostream>
#include <cmath>
#include <allegro.h>
using namespace std;

int main()
{
    int n;
    float wave,i,l;
    cout<<"Enter the quantum level,n:=";
    cin>>n;
    cout<<"Enter the size of the box learn=";
    cin>>l;
    allegro_init();
    install_keyboard();
    set_gfx_mode(GFX_AUTODETECT_WINDOWED,800,480,0,0);
    clear_to_color(screen,makecol(255,255,255)); 
    float xprev=50;
    float yprev=300;  
    for(i=0;i<=l;i++)
    {
        wave=sqrt(2.0/l)*sin(n*3.14*i/l);
        wave=-wave;
        line(screen,xprev,yprev,50+20*i,300+500*wave,makecol(0,0,0));
        xprev=50+20*i;
        yprev=300+500*wave;
    }
    readkey();
}
